<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- .trim修饰符可以去除表单输入的前后空格 -->
        <input type="text" name="userName" v-model.trim="userName">输入姓名<br>
        <!--.lazy当表单失去焦点时，才收集数据-->
        <input type="password" name="password" v-model.lazy="password">输入密码
        <!-- .number把字符串转为number类型 -->
        <input type="text" name="age" v-model.number="age">输入年纪
        
    </div>

    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    userName:'',
                    password:'',
                    age:null
                }
            }
        })
    </script>
</body>
</html>